import request from '@/utils/taskhttp'
import api from "@/utils/taskapi"

// 任务3期

export function getRealTaskInfo(data, success) {
    request(api.getRealTaskInfo, data, (res => {
        success(res)
    }))
}
export function updateRealTask(data, success) {
    request(api.updateRealTask, data, (res => {
        success(res)
    }))
}


// 2.0
//获取任务列表
export function getworkList(data, success) {
    request(api.getTaskList, data, (res => {
        success(res)
    }))
}

//新增任务
export function addTask(data, success) {
    request(api.createTaskDefine, data, (res => {
        success(res)
    }))
}

//更改任务状态（启用/禁用）
export function updateStatus(data, success) {
    request(api.updateTaskStatus, data, (res => {
        success(res)
    }))
}

//任务明细列表（传id）
export function getTaskDetail(data, success) {
    request(api.getAllocateListByTask, data, (res => {
        success(res)
    }))
}

//任务明细详情（传id）
export function getTaskMinute(data, success) {
    request(api.getAllocateInfo, data, (res => {
        success(res)
    }))
}

//添加任务材料
export function uploadTaskMedia(data, success) {
    request(api.createTaskMedia, data, (res => {
        success(res)
    }))
}

//获取任务材料列表
export function getMediaInfo(data, success) {
    request(api.taskMediaInfo, data, (res => {
        success(res)
    }))
}

//删除任务材料
export function deleteMedia(data, success) {
    request(api.deleteTaskMedia, data, (res => {
        success(res)
    }))
}

//编辑任务材料
export function updateMedia(data, success) {
    request(api.updateTaskMedia, data, (res => {
        success(res)
    }))
}

//任务列表 点击编辑 获取任务详情
export function getTaskInfo(data, success) {
    request(api.getTaskDefineInfo, data, (res => {
        success(res)
    }))
}

//任务列表 点击编辑 更改任务详情
export function updateTaskInfo(data, success) {
    request(api.updateTaskDefine, data, (res => {
        success(res)
    }))
}

//传excel
export function updateExcel(data, success) {
    request(api.importStoreExcel, data, (res => {
        success(res)
    }))
}
// 导购excel
export function uploadDealerExecl(data, success) {
    request(api.uploadDealerExecl, data, (res => {
        success(res)
    }))
}
// 门店excel
export function uploadStoreExecl(data, success) {
    request(api.uploadStoreExecl, data, (res => {
        success(res)
    }))
}
//取消子任务
export function cancelChildTask(data, success) {
    request(api.cancelTask, data, (res => {
        success(res)
    }))
}

//获取目标会员
export function getTaskCust(data, success) {
    request(api.getWebTaskCustList, data, (res => {
        success(res)
    }))
}
//获取目标会员3期
export function getTaskCustBox(data, success) {
    request(api.getTaskCust, data, (res => {
        success(res)
    }))
}
//获取会员反馈
export function getVipFeedback(data, success) {
    request(api.getCustFeedback, data, (res => {
        success(res)
    }))
}

export function getAllocateMediaInfo(data, success) {
    request(api.allocateMediaInfo, data, (res => {
        success(res)
    }))
}
// 获取详情页面任务类型
export function getTaskObject(data, success) {
    request(api.getTaskObject, data, (res => {
        success(res)
    }))
}